package ioStream.file.processStream.characterStream;

import java.io.*;

/**
 * Created with IntelliJ IDEA
 * Description:
 * User:22954
 * Date:2024-03-17
 * Time:19:32
 */
@SuppressWarnings("all")
public class BufferedCopy {
    public static void main(String[] args) {
        String srcFilePath = "C:\\Users\\22954\\Desktop\\IDEA\\Java\\Test\\src\\test\\Test3.java";
        String desFilePath = "f:/Test/test1.java";
        BufferedWriter bw = null;
        BufferedReader br = null;
        try {
            bw = new BufferedWriter(new FileWriter(desFilePath));
            br = new BufferedReader(new FileReader(srcFilePath));
            String line = null;
            while ((line = br.readLine()) != null) {
                bw.write(line);
                bw.newLine();
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally {
            try {
                bw.close();
                br.close();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
    }
}
